/**
 * 
 */
package ch.unizh.ifi.ailab.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.InvalidPropertiesFormatException;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import ch.unizh.ifi.ailab.config.LocalizationSettings;
import ch.unizh.ifi.ailab.config.ProgramSettings;
import ch.unizh.ifi.ailab.config.PropertyFileFilter;
import ch.unizh.ifi.ailab.utils.Utils;

/**
 * @author hans jaeckle jaeckle@gmail.com
 * 
 */
public class Gui2007 extends JFrame {

	private static final long serialVersionUID = 1L;

	private Dimension defaultSize = new Dimension(450, 580);

	private JPanel jContentPane = null;

	private JPanel statusPanel = null;

	private JButton notStopButton = null;

	private JTabbedPane tabbedPane = null;

	private JPanel steeringTab = null;

	private JPanel editorTab = null;

	private JMenuBar myMenuBar = null;

	private JMenu fileMenu = null;

	private JMenu suitcaseMenu = null;

	private JMenu cameraMenu = null;

	private JMenu aiMenu = null;

	private JMenu helpMenu = null;

	private JMenu languageMenu = null;

	private JMenuItem germanMenuItem = null;

	private JMenuItem englishMenuItem = null;

	private JMenuItem openPropFileMenuItem = null;

	private JMenuItem savePropFileMenuItem = null;

	private JMenuItem resetDefaultPropMenuItem = null;

	private JMenuItem mockSuitMenuItem = null;

	private JMenuItem exitMenuItem = null;

	private JMenuItem saveAsPropFileMenuItem = null;

	private JMenuItem startSuitMenuItem = null;

	private JMenuItem stopSuitMenuItem = null;

	private JMenuItem startCamMenuItem = null;

	private JMenuItem stopCamMenuItem = null;

	private JMenuItem recordMenuItem = null;

	private JMenuItem snapShotMenuItem = null;

	private JMenuItem startAiMenuItem = null;

	private JMenuItem stopAiMenuItem = null;

	private JMenuItem aboutMenuItem = null;

	private JMenuItem helpMenuItem = null;

	// die properties
	private static ProgramSettings properties = null;

	// die lokalisierung
	private static LocalizationSettings localization = null;

	// logging
	private Logger myLog = Logger.getLogger(Gui2007.class); // @jve:decl-index=0:

	/**
	 * This is the default constructor
	 */
	public Gui2007() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		// apple/OSX speziefisch:
		if (System.getProperty("mrj.version") != null) {
			System.setProperty("apple.laf.useScreenMenuBar", "true");
			System.setProperty(
					"com.apple.mrj.application.apple.menu.about.name",
					"Null15 KI Control");
		}
		properties = ProgramSettings.getProgramSettings();
		localization = LocalizationSettings.getLocalizationSettings();

		String localizationFilePath = new String(Utils.path(properties
				.getProperty("path.conf"), "localization_"
				+ properties.getProperty("defaultLocale") + ".prop"));
		File localizationFile = new File(localizationFilePath);
		try {
			if (localizationFile.exists()) {
				localization.loadFromXML(new FileInputStream(localizationFile));
				myLog.debug("lokalisierung ["
						+ properties.getProperty("defaultLocale")
						+ "] geladen.");
			} else {
				myLog.warn("konnte gewünschte lokalisierung ["
						+ properties.getProperty("defaultLocale")
						+ "] nicht laden.");
				localizationFile = new File(Utils.path(properties
						.getProperty("path.conf"), "localization_default.prop"));
				if (localizationFile.exists()) {
					localization.loadFromXML(new FileInputStream(
							localizationFile));
					myLog.debug("lokalisierung [default] geladen.");
				} else {
					myLog.error("konnte keine lokalisierungsdateien finden.");
				}
			}
		} catch (InvalidPropertiesFormatException e) {
			myLog.error("fehlerhaftes properties file: " + e.toString());
		} catch (FileNotFoundException e) {
			myLog.error("properties file nicht gefunden: " + e.toString());
		} catch (IOException e) {
			myLog.error("io fehler: " + e.toString());
		}
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setSize(defaultSize);
		this.setJMenuBar(getMyMenuBar());
		this.setPreferredSize(defaultSize);
		this.setContentPane(getJContentPane());
		this.setTitle(localization.getProperty("loc-Gui2007-title"));
		this.setVisible(true);
	}

	/**
	 * öffnet einen dialog zum aussuchen einer datei und lädt die gewählte
	 * datei. als default wird current_save.prop gewählt.
	 */
	private void loadPropertyFile() {
		String fileName = "current_save.prop";
		File file = new File(Utils.path(properties.getProperty("path.conf"),
				fileName));
		JFileChooser chooser = new JFileChooser();
		chooser.setFileHidingEnabled(true);
		chooser.setFileFilter(new PropertyFileFilter());
		chooser.setCurrentDirectory(file);

		int returnVal = chooser.showOpenDialog(this);
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			file = chooser.getSelectedFile();
			FileInputStream is = null;
			try {
				is = new FileInputStream(file);
				properties.loadFromXML(is);

				myLog.info("gui: properties laden: abgeschlossen. "
						+ file.getName());
			} catch (InvalidPropertiesFormatException e) {
				myLog.error("gui: properties laden: fehlerhafte  datei.");
			} catch (FileNotFoundException e) {
				myLog.error("gui: properties laden: datei nicht vorhanden.");
			} catch (IOException e) {
				myLog.error("gui: properties laden: allgemeiner fehler."
						+ e.toString());
			} finally {
				if (is != null) {
					try {
						is.close();
					} catch (IOException e) {
					}
				}
			}
		} else {
			myLog.debug("gui: property open command cancelled by user.");
		}

	}

	/**
	 * stellt die standard kofiguration wieder her.
	 */
	private void loadDefaultPropertyFile() {
		properties.configDefaults();
	}

	private void savePropertiesAs() {
		File file = new File(Utils.path(properties.getProperty("path.conf"),
				"current_save.prop"));
		JFileChooser chooser = new JFileChooser(file);
		chooser.setSelectedFile(file);
		chooser.setFileFilter(new PropertyFileFilter());
		boolean write = false;

		int returnVal = chooser.showSaveDialog(this);
		if (returnVal == JFileChooser.APPROVE_OPTION) {
			write = true;
			file = chooser.getSelectedFile();
			if (file.exists()) {
				if (JOptionPane
						.showConfirmDialog(
								this,
								file.getName()
										+ localization
												.getProperty("loc-Gui2007-overWriteMessage"),
								localization
										.getProperty("loc-Gui2007-overWriteMessageTitle"),
								JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) {
					write = true;
				} else {
					write = false;
				}
			}
			if (write) {
				savePropertyFile(file);
			} else {
				myLog.debug("gui: save command cancelled by user.");
			}
		}
	}

	/**
	 * öffnet einen dialog zum speichern der properties. als default wird
	 * current_save.prop gewählt.
	 */
	private void savePropertyFile(File file) {
		if (file == null) {
			file = new File(Utils.path(properties.getProperty("path.conf"),
					"current.prop"));
		}
		FileOutputStream os = null;
		try {
			os = new FileOutputStream(file);
			String comment = "User Saved Properties";
			properties.storeToXML(os, comment, properties
					.getProperty("encoding"));
			properties.setProperty("currentFile", file.getPath());
			myLog.info("gui: properties speichern: abgeschlossen.");
		} catch (NullPointerException e) {
			myLog
					.info("gui: properties speichern: abgebrochen "
							+ e.toString());
		} catch (FileNotFoundException e) {
			myLog
					.info("gui: properties speichern: abgebrochen "
							+ e.toString());
		} catch (IOException e) {
			myLog
					.info("gui: properties speichern: abgebrochen "
							+ e.toString());
		} finally {
			if (os != null) {
				try {
					os.close();
				} catch (IOException e) {
				}
			}
		}
	}

	private void exitGui(int exitValue) {
		myLog.info("exit robosuitcase controlling application");
		System.exit(0);
	}

	private void emergencyStop() {
		myLog.debug("emergency stop pressed.");
	}

	private void showAbout() {
		JDialog dialog = new AboutDialog2007(this);
		dialog.setVisible(true);
	}

	/**
	 * This method initializes statusPanel
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getStatusPanel() {
		if (statusPanel == null) {
			GridBagConstraints gridBagConstraints = new GridBagConstraints();
			gridBagConstraints.gridx = 0;
			gridBagConstraints.gridy = 0;
			statusPanel = new JPanel();
			statusPanel.setLayout(new GridBagLayout());
			statusPanel.add(getNotStopButton(), gridBagConstraints);
		}
		return statusPanel;
	}

	/**
	 * This method initializes notStopButton
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getNotStopButton() {
		if (notStopButton == null) {
			notStopButton = new JButton();
			notStopButton.setText(localization
					.getProperty("loc-Gui2007-notStopButton"));
			notStopButton.setForeground(Color.RED);
			notStopButton
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							emergencyStop();
						}
					});
		}
		return notStopButton;
	}

	/**
	 * This method initializes tabbedPane
	 * 
	 * @return javax.swing.JTabbedPane
	 */
	private JTabbedPane getTabbedPane() {
		if (tabbedPane == null) {
			tabbedPane = new JTabbedPane();
			tabbedPane.addTab(localization
					.getProperty("loc-Gui2007-tabbedPaneRemote"), null,
					getSteeringTab(), null);
			tabbedPane.addTab(localization
					.getProperty("loc-Gui2007-tabbedPaneSettings"), null,
					getEditorTab(), null);
		}
		return tabbedPane;
	}

	/**
	 * This method initializes steeringTab
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getSteeringTab() {
		if (steeringTab == null) {
			steeringTab = new SteeringTab();
		}
		return steeringTab;
	}

	/**
	 * This method initializes editorTab
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getEditorTab() {
		if (editorTab == null) {
			editorTab = new EditorTab();
		}
		return editorTab;
	}

	/**
	 * This method initializes myMenuBar
	 * 
	 * @return javax.swing.JMenuBar
	 */
	private JMenuBar getMyMenuBar() {
		if (myMenuBar == null) {
			myMenuBar = new JMenuBar();
			myMenuBar.add(getFileMenu());
			myMenuBar.add(getSuitcaseMenu());
			myMenuBar.add(getCameraMenu());
			myMenuBar.add(getAiMenu());
			myMenuBar.add(getHelpMenu());
		}
		return myMenuBar;
	}

	/**
	 * This method initializes fileMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getFileMenu() {
		if (fileMenu == null) {
			fileMenu = new JMenu();
			fileMenu.setText(localization.getProperty("loc-Gui2007-fileMenu"));
			fileMenu.add(getLanguageMenu());
			fileMenu.addSeparator();
			fileMenu.add(getOpenPropFileMenuItem());
			fileMenu.add(getResetDefaultPropMenuItem());
			fileMenu.addSeparator();
			fileMenu.add(getSavePropFileMenuItem());
			fileMenu.add(getSaveAsPropFileMenuItem());
			fileMenu.addSeparator();
			fileMenu.add(getExitMenuItem());
		}
		return fileMenu;
	}

	private JMenu getLanguageMenu() {
		if (languageMenu == null) {
			languageMenu = new JMenu();
			languageMenu.setText(localization
					.getProperty("loc-Gui2007-languageMenu"));
			languageMenu.add(getGermanMenuItem());
			languageMenu.add(getEnglishMenuItem());
		}
		return languageMenu;
	}

	private JMenuItem getGermanMenuItem() {
		if (germanMenuItem == null) {
			germanMenuItem = new JMenuItem();
			germanMenuItem.setText(localization
					.getProperty("loc-Gui2007-germanMenuItem"));
			germanMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							properties.setProperty("defaultLocale", "de");
							File file = new File(Utils.path(properties
									.getProperty("path.conf"), "current.prop"));
							savePropertyFile(file);
						}
					});
		}
		return germanMenuItem;
	}

	private JMenuItem getEnglishMenuItem() {
		if (englishMenuItem == null) {
			englishMenuItem = new JMenuItem();
			englishMenuItem.setText(localization
					.getProperty("loc-Gui2007-englishMenuItem"));
			englishMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							properties.setProperty("defaultLocale", "en");
							File file = new File(Utils.path(properties
									.getProperty("path.conf"), "current.prop"));
							savePropertyFile(file);
						}
					});
		}
		return englishMenuItem;
	}

	/**
	 * This method initializes suitcaseMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getSuitcaseMenu() {
		if (suitcaseMenu == null) {
			suitcaseMenu = new JMenu();
			suitcaseMenu.setText(localization
					.getProperty("loc-Gui2007-suitcaseMenu"));
			suitcaseMenu.add(getMockSuitMenuItem());
			suitcaseMenu.add(getStartSuitMenuItem());
			suitcaseMenu.add(getStopSuitMenuItem());
		}
		return suitcaseMenu;
	}

	/**
	 * This method initializes cameraMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getCameraMenu() {
		if (cameraMenu == null) {
			cameraMenu = new JMenu();
			cameraMenu.setText(localization
					.getProperty("loc-Gui2007-cameraMenu"));
			cameraMenu.add(getStartCamMenuItem());
			cameraMenu.add(getStopCamMenuItem());
			cameraMenu.add(getRecordMenuItem());
			cameraMenu.add(getSnapShotMenuItem());
		}
		return cameraMenu;
	}

	/**
	 * This method initializes aiMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getAiMenu() {
		if (aiMenu == null) {
			aiMenu = new JMenu();
			aiMenu.setText(localization.getProperty("loc-Gui2007-aiMenu"));
			aiMenu.add(getStartAiMenuItem());
			aiMenu.add(getStopAiMenuItem());
		}
		return aiMenu;
	}

	/**
	 * This method initializes helpMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getHelpMenu() {
		if (helpMenu == null) {
			helpMenu = new JMenu();
			helpMenu.setText(localization.getProperty("loc-Gui2007-helpMenu"));
			helpMenu.add(getAboutMenuItem());
			helpMenu.add(getHelpMenuItem());
		}
		return helpMenu;
	}

	/**
	 * This method initializes openPropFileMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getOpenPropFileMenuItem() {
		if (openPropFileMenuItem == null) {
			openPropFileMenuItem = new JMenuItem();
			openPropFileMenuItem.setText(localization
					.getProperty("loc-Gui2007-openPropFileMenuItem"));
			openPropFileMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							loadPropertyFile();
						}
					});
		}
		return openPropFileMenuItem;
	}

	/**
	 * This method initializes savePropFileMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getSavePropFileMenuItem() {
		if (savePropFileMenuItem == null) {
			savePropFileMenuItem = new JMenuItem();
			savePropFileMenuItem.setText(localization
					.getProperty("loc-Gui2007-savePropFileMenuItem"));
			savePropFileMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							savePropertyFile(null);
						}
					});
		}
		return savePropFileMenuItem;
	}

	/**
	 * This method initializes resetDefaultPropMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getResetDefaultPropMenuItem() {
		if (resetDefaultPropMenuItem == null) {
			resetDefaultPropMenuItem = new JMenuItem();
			resetDefaultPropMenuItem.setText(localization
					.getProperty("loc-Gui2007-resetDefaultPropMenuItem"));
			resetDefaultPropMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							loadDefaultPropertyFile();
						}
					});
		}
		return resetDefaultPropMenuItem;
	}

	/**
	 * This method initializes mockSuitMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getMockSuitMenuItem() {
		if (mockSuitMenuItem == null) {
			mockSuitMenuItem = new JMenuItem();
			mockSuitMenuItem.setText(localization
					.getProperty("loc-Gui2007-mockSuitMenuItem"));
		}
		return mockSuitMenuItem;
	}

	/**
	 * This method initializes exitMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getExitMenuItem() {
		if (exitMenuItem == null) {
			exitMenuItem = new JMenuItem();
			exitMenuItem.setText(localization
					.getProperty("loc-Gui2007-exitMenuItem"));
			exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					exitGui(0);
				}
			});
		}
		return exitMenuItem;
	}

	/**
	 * This method initializes saveAsPropFileMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getSaveAsPropFileMenuItem() {
		if (saveAsPropFileMenuItem == null) {
			saveAsPropFileMenuItem = new JMenuItem();
			saveAsPropFileMenuItem.setText(localization
					.getProperty("loc-Gui2007-saveAsPropFileMenuItem"));
			saveAsPropFileMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							savePropertiesAs();
						}
					});
		}
		return saveAsPropFileMenuItem;
	}

	/**
	 * This method initializes startSuitMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStartSuitMenuItem() {
		if (startSuitMenuItem == null) {
			startSuitMenuItem = new JMenuItem();
			startSuitMenuItem.setText(localization
					.getProperty("loc-Gui2007-startSuitMenuItem"));
		}
		return startSuitMenuItem;
	}

	/**
	 * This method initializes stopSuitMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStopSuitMenuItem() {
		if (stopSuitMenuItem == null) {
			stopSuitMenuItem = new JMenuItem();
			stopSuitMenuItem.setText(localization
					.getProperty("loc-Gui2007-stopSuitMenuItem"));
		}
		return stopSuitMenuItem;
	}

	/**
	 * This method initializes startCamMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStartCamMenuItem() {
		if (startCamMenuItem == null) {
			startCamMenuItem = new JMenuItem();
			startCamMenuItem.setText(localization
					.getProperty("loc-Gui2007-startCamMenuItem"));
		}
		return startCamMenuItem;
	}

	/**
	 * This method initializes stopCamMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStopCamMenuItem() {
		if (stopCamMenuItem == null) {
			stopCamMenuItem = new JMenuItem();
			stopCamMenuItem.setText(localization
					.getProperty("loc-Gui2007-stopCamMenuItem"));
		}
		return stopCamMenuItem;
	}

	/**
	 * This method initializes recordMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getRecordMenuItem() {
		if (recordMenuItem == null) {
			recordMenuItem = new JMenuItem();
			recordMenuItem.setText(localization
					.getProperty("loc-Gui2007-recordMenuItem"));
		}
		return recordMenuItem;
	}

	/**
	 * This method initializes snapShotMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getSnapShotMenuItem() {
		if (snapShotMenuItem == null) {
			snapShotMenuItem = new JMenuItem();
			snapShotMenuItem.setText(localization
					.getProperty("loc-Gui2007-snapShotMenuItem"));
		}
		return snapShotMenuItem;
	}

	/**
	 * This method initializes startAiMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStartAiMenuItem() {
		if (startAiMenuItem == null) {
			startAiMenuItem = new JMenuItem();
			startAiMenuItem.setText(localization
					.getProperty("loc-Gui2007-startAiMenuItem"));
		}
		return startAiMenuItem;
	}

	/**
	 * This method initializes stopAiMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getStopAiMenuItem() {
		if (stopAiMenuItem == null) {
			stopAiMenuItem = new JMenuItem();
			stopAiMenuItem.setText(localization
					.getProperty("loc-Gui2007-stopAiMenuItem"));
		}
		return stopAiMenuItem;
	}

	/**
	 * This method initializes aboutMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getAboutMenuItem() {
		if (aboutMenuItem == null) {
			aboutMenuItem = new JMenuItem();
			aboutMenuItem.setText(localization
					.getProperty("loc-Gui2007-aboutMenuItem"));
			aboutMenuItem
					.addActionListener(new java.awt.event.ActionListener() {
						public void actionPerformed(java.awt.event.ActionEvent e) {
							showAbout();
						}
					});
		}
		return aboutMenuItem;
	}

	/**
	 * This method initializes helpMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getHelpMenuItem() {
		if (helpMenuItem == null) {
			helpMenuItem = new JMenuItem();
			helpMenuItem.setText(localization
					.getProperty("loc-Gui2007-helpMenuItem"));
		}
		return helpMenuItem;
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(new BorderLayout());
			jContentPane.add(getStatusPanel(), BorderLayout.SOUTH);
			jContentPane.add(getTabbedPane(), BorderLayout.CENTER);
		}
		return jContentPane;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// initialize properties. defaultpath necessary
		ProgramSettings.getProgramSettings().setProperty("path.conf",
				Utils.path(System.getProperty("user.dir"), "conf"));

		// configure logging
		PropertyConfigurator.configure(Utils.path(ProgramSettings
				.getProgramSettings().getProperty("path.conf"),
				"Null15Logger.conf"));

		// apple speziefisch:
		if (System.getProperty("mrj.version") != null) {
			System.setProperty("apple.laf.useScreenMenuBar", "true");
			System.setProperty(
					"com.apple.mrj.application.apple.menu.about.name",
					"Null15 KI Control");
		}
		new Gui2007();
	}

} // @jve:decl-index=0:visual-constraint="111,8"
